package org.example.controller;

import org.example.entity.User;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author jiangyong
 */
@RestController
@RequestMapping("/test")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("findAll")
    public List<User> findAll(@RequestParam int id) {
        return userService.findAll(id);
    }

    @PostMapping("saveAll")
    public Integer saveAll(@RequestBody User user) {
        return userService.saveAll(user);
    }


}